﻿@model IEnumerable<prohomework.Models.homeworkIndex>


@*@using (Html.BeginForm("BatchstudentsDelete", "Teacher", FormMethod.Post, new { @id="binddelete"}))
{
    
           @Html.Hidden("fengyeschoolid", ViewData["schoolid"]);
           @Html.Hidden("fengyelevelid", ViewData["levelid"]);    
           @Html.Hidden("fengyestudentclassid", ViewData["studentclassid"]);        
    <p><input type="button" onclick="delIds();" value="批量删除" class="btn" /></p>     
"RecCheckwork", "Teacher", FormMethod.Post
*@
@*<script src="@Url.Content("~/Scripts/jquery-1.9.1.min.js")" type="text/javascript"></script>*@
  <script src="@Url.Content("~/Scripts/jquery-1.7.1.js")" type="text/javascript"></script>  
<script type="text/jscript">
    //function confirmDel(itemId) {
    //    if (confirm("确认删除吗?")) {
    //        window.location.href = "/UserInfo/Delete/" + itemId;
    //    }
    //}
    function selectAll() {
        var checked = $("#ckAll").get(0).checked;
       $("input[name='ckSelect']").attr("checked", checked);
        $("input[name='ckSelect']").get(0).checked=checked;
        if (checked) {
            $("#spInfo").html("反选");
        } else {
            $("#spInfo").html("全选");
            $("input[name='ckSelect']").attr("checked", false);
        }
    }

    function delIds() {
        //   if (confirm("确认要删除选中数据吗?")) {
              var checkedCount = $("input[name='ckSelect']:checked").length;
        if (checkedCount <= 0) {
            alert("请选择下载项！");
            return false;
            //   $("#binddelete").submit();//提交表单
            //    } else {
            //       alert("请先选择操作项!");
            //   }

            //  }
        }
    }
</script>

<p>作业：@ViewData["zuoyename"]  班级：@ViewData["classname"] </p>
@using (Html.BeginForm())
 {

<table class="table table-bordered table-striped .active .table-condensed " style="width:100%;text-align:center">
    <tr style="text-align:center">
          <th  style="width:8%">
            <input type="checkbox" name="ckAll" id="ckAll" onclick="selectAll();" /><small id="spInfo"  style="font-size:x-small">全选</small> 
        </th>
        <th style="width:15%;text-align:center">
           序号
        </th>
        <th>
           学号
        </th>
        <th  style="width:15%">
            姓名
        </th>
        <th style="width:15%">
           提交时间
        </th>
        <th>
            来自
        </th>
        <th>
            文件
        </th>
        <th>
            批阅
        </th>
        <th style="width:30%">
            批注
        </th>
    </tr>

@foreach (var item in Model) {

    <tr>
         <td>
           @Html.CheckBox("ckSelect", false, new { value = item.xuehao })
        </td>

        <td>
            @Html.DisplayFor(modelItem => item.xuhao)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.xuehao)
        </td>
        <td style="width:200px">
            @Html.DisplayFor(modelItem => item.name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.datetime)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ipadress)
        </td>
        <td>
            @if(item.filename!=""){
            @Html.ActionLink(item.filename, "download", new {  xuehao=item.xuehao,workid= ViewData["zuoyeid"] })
         }</td>

        <td>@Html.DropDownList("piyue"+item.xuhao,item.piyue as IEnumerable<SelectListItem>)</td>
        <td>
            @Html.TextBox("pizhi" + item.xuhao, item.pizhi, new { @class="form-control"})

            @Html.Hidden(item.xuhao ,item.xuehao)
      
        </td>
@*        <td>
            @Html.ActionLink("Edit", "Edit", new { /* id=item.PrimaryKey */ }) |
            @Html.ActionLink("Details", "Details", new { /* id=item.PrimaryKey */ }) |
            @Html.ActionLink("Delete", "Delete", new { /* id=item.PrimaryKey */ })
        </td>*@

    </tr>
}
<tr>
    <td colspan="9" > 
         <input type="submit" value="批量下载" class="btn" onclick="delIds()"   name="mutipledownload"/>           
        <input type="submit" value="提交" name="tijiao"  class="btn" />
         <input  class="btn" type="reset" value="重置"  style="width:50px" />
  

    </td>


</tr>
</table>
                @Html.Hidden("zuoyeid",ViewData["zuoyeid"])
                @Html.Hidden("listcount",ViewData["listcount"])
                @Html.Hidden("classname",ViewData["classname"] )
                    @Html.Hidden("zuoyename",ViewData["zuoyename"])
    

 }
    
    



   @*         <input type="submit" value="保存并发布" name="SavePublish" />
            <input type="submit" value="保存草稿", name="Save"/ >*@